﻿using System.Text;

namespace HamcoWcs.Models.DeviceMsgs.BconMsgs.BconSendTel
{
    public class BconTel_DC : BconBaseTel
    {
        public string RequestType { get; set; }
        public string Device_ID { get; set; }
        public string Parcel_ID { get; set; }
        public string Parcel_TaskID { get; set; }
        public string Destination01 { get; set; }
        public string Destination02 { get; set; }
        public string Barcode { get; set; }

        public override string Encode()
        {
            StringBuilder transText = new StringBuilder();
            transText.Append("<<");
            transText.Append(Tel_Type);
            transText.Append("009");
            transText.Append(RequestType.PadLeft(1, '0'));
            transText.Append(Device_ID.PadLeft(4, '0'));
            transText.Append(Parcel_ID.PadLeft(3, '0'));
            transText.Append(Parcel_TaskID.PadLeft(15, '0'));
            transText.Append(Destination01.PadLeft(4, '0'));
            transText.Append(Destination02.PadLeft(4, '0'));
            transText.Append(Barcode.PadLeft(40, '0'));
            transText.Append(">>");
            return transText.ToString();
        }
    }
}
